# 基于运行时的测试
FROM java-17-runtime:v1

# set timezone
ENV TimeZone Asia/Shanghai

RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone && apk del tzdata

ENV CODE_HOME /code

ENV FC_FUNC_CODE_PATH ${CODE_HOME}
ENV FC_FUNC_HANDLER example.StreamHandler::handleRequest
ENV FC_FUNC_INTTIALIZER example.StreamHandler::initialize
ENV FC_FUNC_PRESTOP example.StreamHandler::preStop

RUN rm -rf ${CODE_HOME}/*

COPY code.jar ${CODE_HOME}/

EXPOSE 8080

CMD ./bootstrap.sh